package com.lagou.advice;

import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * 通知类
 */
@Component
@Aspect
public class MyAdvice {
    @Pointcut("execution(* com.lagou.service.impl.AccountServiceImpl.*(.. ))")
    public void myPoincut(){}

    @Before("MyAdvice.myPoincut()")
    public void before(){
        System.out.println("这是一个前置通知...");
    }
    @AfterReturning("MyAdvice.myPoincut()")
    public void after(){
        System.out.println("这是一个后置通知...");
    }
}
